package com.ship.job.task;

import com.ship.system.api.RemoteCommonService;
import com.ship.system.api.RemoteDispatchService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 消息提醒定时任务调度
 * 
 * @author zhangyh
 */
@Component("messageSendConfigTask")
public class MessageSendConfigTask
{
    @Resource
    private RemoteCommonService remoteCommonService;

    @Resource
    private RemoteDispatchService remoteDispatchService;

    public void expiredMessageSend()
    {
        System.out.println("到期消息提醒定时触发任务开始============================================");
        //各类型合同到期提醒
        remoteCommonService.contractExpireMessageSend();

        //调度模块定期提醒
        remoteDispatchService.dispatchExpireMessageSend();


        System.out.println("到期消息提醒定时触发任务结束============================================");
    }


    /**
     * 保存当前可用船只和ais状态
     */
    // 0 */2 * * * ?
    public void currentlyAvailableVessels() {
        System.out.println("保存当前可用船只和ais状态定时触发任务开始============================================");

        remoteDispatchService.setShipImo();

        remoteDispatchService.setImoStatus();

        System.out.println("保存当前可用船只和ais状态定时触发任务结束============================================");
    }
}
